home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / gadgets / layout.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-19  |  13.3 KB  |  382 lines

  1. #ifndef GADGETS_LAYOUT_H
  2. #define GADGETS_LAYOUT_H
  3. /*
  4. **    $VER: layout.h 44.1 (19.10.1999)
  5. **    Includes Release 44.1
  6. **
  7. **  Definitions for the layout.gadget BOOPSI class
  8. **
  9. **    (C) Copyright 1987-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. /*****************************************************************************/
  14.  
  15. #ifndef REACTION_REACTION_H
  16. #include <reaction/reaction.h>
  17. #endif
  18.  
  19. #ifndef INTUITION_GADGETCLASS_H
  20. #include <intuition/gadgetclass.h>
  21. #endif
  22.  
  23. #ifndef IMAGES_BEVEL_H
  24. #include <images/bevel.h>
  25. #endif
  26.  
  27. /*****************************************************************************/
  28.  
  29. struct WeightObject    /* filled in by layout.gadget for weighbar */
  30. {
  31.     ULONG wb_SuccHeight;
  32.     ULONG wb_PredHeight;
  33.     ULONG wb_Reserved1;    // currently unused.
  34.  
  35.     ULONG wb_SuccWidth;
  36.      ULONG wb_PredWidth;
  37.     ULONG wb_Reserved2;    // currently unused.
  38. };
  39.  
  40. /*****************************************************************************/
  41.  
  42. struct LayoutLimits    /* filled by the LayoutLimits() call */
  43. {
  44.     UWORD MinWidth;
  45.     UWORD MinHeight;
  46.     UWORD MaxWidth;
  47.     UWORD MaxHeight;
  48. };
  49.  
  50. /*****************************************************************************/
  51.  
  52. #define LAYOUT_Dummy            (REACTION_Dummy+0x7000)
  53.  
  54. #define LAYOUT_Orientation        (LAYOUT_Dummy+1)
  55.     /* (ULONG) Orientation of group, LAYOUT_ORIENT_HORIZ or
  56.      * LAYOUT_ORIENT_VERT.  Defaults to LAYOUT_ORIENT_HORIZ. */
  57.  
  58. #define LAYOUT_FixedHoriz        (LAYOUT_Dummy+2)
  59. #define LAYOUT_FixedVert        (LAYOUT_Dummy+3)
  60.     /* (BOOL) TRUE for fixed-size group, false to force that direction to its
  61.      * smallest possible size. */
  62.  
  63. #define LAYOUT_HorizAlignment    (LAYOUT_Dummy+4)
  64.     /* (ULONG) Align to left, right, or center of group space, defaults to
  65.      * LAYOUT_ALIGN_LEFT. */
  66.  
  67. #define LAYOUT_VertAlignment    (LAYOUT_Dummy+5)
  68.     /* (ULONG) Align to top, bottom, or center of group space, defaults to
  69.      * LAYOUT_ALIGN_TOP. */
  70.  
  71. #define LAYOUT_ShrinkWrap        (LAYOUT_Dummy+6)
  72.     /* (BOOL) Shrink out all extra space between gadgets. Default FALSE. */
  73.  
  74. #define LAYOUT_EvenSize            (LAYOUT_Dummy+7)
  75.     /* (BOOL) Use the minimum size of the largest child for all children.
  76.      * Default FALSE. */
  77.  
  78. #define LAYOUT_InnerSpacing        (LAYOUT_Dummy+9)
  79.     /* (ULONG) Spacing between objects. Defaults to INTERSPACING.
  80.      */
  81.  
  82. #define LAYOUT_HorizSpacing LAYOUT_InnerSpacing    /* OBSOLETE */
  83. #define LAYOUT_VertSpacing LAYOUT_InnerSpacing
  84.  
  85. #define INTERSPACING 4        /* virtual pixels */
  86. #define INTERSPACE INTERSPACING
  87.  
  88. #define LAYOUT_TopSpacing       (LAYOUT_Dummy+10)
  89.     /* (ULONG) The minimum space between the top of the group, and the top of
  90.      * the objects inside it. */
  91.  
  92. #define LAYOUT_BottomSpacing    (LAYOUT_Dummy+11)
  93.     /* (ULONG) The minimum space between the bottom of the group, and the
  94.      * bottom of the objects inside it. */
  95.  
  96. #define LAYOUT_LeftSpacing      (LAYOUT_Dummy+12)
  97.     /* (ULONG) The minimum space between the left side of the group, and the
  98.      * left side of the objects inside it. */
  99.  
  100. #define LAYOUT_RightSpacing     (LAYOUT_Dummy+13)
  101.     /* (ULONG) The minimum space between the right side of the group, and the
  102.      * right side of the object inside it. */
  103.  
  104. #define LAYOUT_BevelState       (LAYOUT_Dummy+14)
  105.     /* (ULONG) Either IDS_SELECTED for recessed, or IDS_NORMAL for raised. */
  106.  
  107. #define LAYOUT_BevelStyle       (LAYOUT_Dummy+15)
  108.     /* (ULONG) See images/bevel.h */
  109.  
  110. #define LAYOUT_Label            (LAYOUT_Dummy+16)
  111.     /* (UBYTE *) The bevel label, as specified by a text string. */
  112.  
  113. #define LAYOUT_LabelImage       (LAYOUT_Dummy+17)
  114.     /* (struct Image *) The bevel label, as specified by an Image. */
  115.  
  116. #define LAYOUT_LabelPlace       (LAYOUT_Dummy+18)
  117.     /* (ULONG) Where to put the label: BVJ_TOP_CENTER, BVJ_TOP_LEFT,
  118.      * BVJ_TOP_RIGHT, BVJ_IN_CENTER, BVJ_IN_LEFT, BVJ_IN_RIGHT */
  119.  
  120. /* The child functions.
  121.  * After one of these functions is called, any CHILD_ tag may be used; it will apply
  122.  * to whichever gadget was the last gadget to be altered by AddGadget/ModifyChild.
  123.  */
  124. #define LAYOUT_RemoveChild      (LAYOUT_Dummy+19)
  125.     /* (Object *) The BOOPSI gadget to be removed.  This will destroy the
  126.      * object, as well. */
  127.  
  128. #define LAYOUT_AddChild         (LAYOUT_Dummy+20)
  129.     /* (Object *) The BOOPSI gadget to be added. */
  130.  
  131. #define LAYOUT_AddImage         (LAYOUT_Dummy+21)
  132.     /* (Object *) like LAYOUT_AddChild, except for images instead of
  133.      * gadgets. */
  134.  
  135. #define LAYOUT_ModifyChild      (LAYOUT_Dummy+22)
  136.     /* (Object *) The BOOPSI gadget to be modified. */
  137.  
  138. /* The following two tags, together with GA_ID, are sent in a notification
  139.  * message when a gadget informs of a release verify.
  140.  */
  141. #define LAYOUT_RelVerify        (LAYOUT_Dummy+23)
  142.     /* (BOOL) Gadget release verify notification tag */
  143.  
  144. #define LAYOUT_RelCode            (LAYOUT_Dummy+24)
  145.     /* (UWORD) Copy of the IntuiMessage.Code from the release verify */
  146.  
  147. #define LAYOUT_Parent            (LAYOUT_Dummy+25)
  148.     /* (Object *) Set the parent layout of a sublayout. Layout will set this
  149.      * automatically for all children (thus any object added to a layout
  150.      * hierarchy will receive this tag in OM_SET). */
  151.  
  152. #define LAYOUT_DeferLayout        (LAYOUT_Dummy+26)
  153.     /* (BOOL) Setting this tag for a top layout will make it defer GM_LAYOUT
  154.      * and GM_RENDER from input.device context and request the application to
  155.      * do them. */
  156.  
  157. #define LAYOUT_RequestLayout    (LAYOUT_Dummy+27)
  158.     /* (Object *) When this tag is received in OM_UPDATE or IDCMP_IDCMPUPDATE,
  159.      * the layout instance in question should be relayouted with the GM_LAYOUT
  160.      * method (or by calling RethinkLayout).  Setting LAYOUT_DeferLayout will
  161.      * make these notifications appear. */
  162.  
  163. #define LAYOUT_RequestRefresh    (LAYOUT_Dummy+28)
  164.     /* (Object *) When this tag is received in OM_UPDATE or IDCMP_IDCMPUPDATE,
  165.      * the layout instance in question should be refreshed with the GM_RENDER
  166.      * method (or by calling RefreshGList).  Setting LAYOUT_DeferLayout will
  167.      * make these notifications appear. */
  168.  
  169. #define LAYOUT_TextPen            (LAYOUT_Dummy+29)
  170.     /* (WORD) Optional text pen color for group label */
  171.  
  172. #define LAYOUT_FillPen            (LAYOUT_Dummy+30)
  173.     /* (WORD) Optional backfill pen color */
  174.  
  175. #define LAYOUT_FillPattern        (LAYOUT_Dummy+31)
  176.     /* (UWORD *) Optional backfill pattern */
  177.  
  178. #define LAYOUT_PageBackFill        (LAYOUT_Dummy+32)
  179.     /* (struct Hook *) !PRIVATE! backfill hook */
  180.  
  181. #define LAYOUT_BackFill            GA_BackFill
  182.     /* (struct Hook *) Optional backfill hook */
  183.  
  184. #define LAYOUT_TabVerify        (LAYOUT_Dummy+33)
  185.     /* (BOOL) TRUE if this release verify was triggered with tabcycling and
  186.      * another gadget has been activated */
  187.  
  188. #define LAYOUT_LabelColumn        (LAYOUT_Dummy+34)
  189.     /* (ULONG) LABELTEXT_LEFT or LABELTEXT_RIGHT, the side where object
  190.      * labels are placed in a vertical group. */
  191.  
  192. #define LAYOUT_LabelWidth        (LAYOUT_Dummy+35)
  193.     /* (ULONG) Width of the the gadget label column. This attribute
  194.      * can be used to justify several layout groups. */
  195.  
  196. #define LAYOUT_AlignLabels        (LAYOUT_Dummy+36)
  197.     /* (Object *) Pointer to another layout object this group should
  198.      * align labels width. Set a cyclic pointer between all the objects
  199.      * and they will automatically make their label columns the same
  200.      * width. These tags should be set as soon as possible, preferably
  201.      * during OM_NEW (One will have to be set afterwards). */
  202.  
  203. #define LAYOUT_SpaceInner        (LAYOUT_Dummy+37)
  204. #define LAYOUT_SpaceOuter     (LAYOUT_Dummy+38)
  205.     /* (BOOL) Whether or not this group should have space around/between
  206.      * objects. For normal layouts, you should use these tags instead
  207.      * of the direct-control LAYOUT_Top/Bottom/Right/Left/InnerSpacing,
  208.      * since these can be automatically adjusted to the resolution
  209.      * for you. */
  210.  
  211. #define LAYOUT_RelAddress        (LAYOUT_Dummy+39)
  212.     /* (struct Gadget *) The address of the gadget that sent a release
  213.      * verify. */
  214.  
  215. #define LAYOUT_HelpHit            (LAYOUT_Dummy+40)
  216.     /* (UWORD) HelpTest return code.
  217.      */
  218.  
  219. #define LAYOUT_HelpGadget        (LAYOUT_Dummy+41)
  220.     /* (struct Gadget *) HelpTest gadget pointer notified with HelpHit! (V44)
  221.      * (OM_NOTIFY)
  222.      */
  223.  
  224. #define LAYOUT_DisposeLabels (LAYOUT_Dummy) /* Was +41!! */
  225.     /* (BOOL) Dispose Labels on exit (OBSOLETE!)
  226.      * (OM_SET/OM_UPDATE)
  227.      */
  228.  
  229. #define LAYOUT_Inverted     (LAYOUT_Dummy+42)
  230.     /* (BOOL) Add group children via AddHead() rather than AddTail()
  231.      * A very simple means to flip a layout group placement (42.25+)
  232.      * Its also highly useful for dynamic layout, inserting the
  233.      * child on the head, or tail (left/right, top/bottom). Changing
  234.      * this tag only effects children added afterward.
  235.      */
  236.  
  237. #define LAYOUT_WeightBar    (LAYOUT_Dummy+43)
  238.     /* (BOOL) Place a user adjustable weighting bar here (ie; balance group bar)
  239.      *  ClassAct 2.1 - V43.1
  240.      */
  241.  
  242. /* Child tags!
  243.  */
  244. #define CHILD_Dummy                (LAYOUT_Dummy+0x100)
  245.  
  246. #define CHILD_MinWidth          (CHILD_Dummy+1)
  247.     /* (ULONG) The minimum width, in pixels, of the object.  Leave blank if
  248.      * you want the minimum size to be calced by the gadget as the smallest
  249.      * possible, or use ~0.  Defaults to ~0. */
  250.  
  251. #define CHILD_MinHeight         (CHILD_Dummy+2)
  252.     /* (ULONG) The minimum height, in pixels, of the object.  Leave blank if
  253.      * you want the minimum size to be calced by the gadget as the smallest
  254.      * possible, or use ~0.  Defaults to ~0. */
  255.  
  256. #define CHILD_NominalSize        (CHILD_Dummy+11)
  257.     /* (BOOL) Use GDOMAIN_NOMINAL instead of GDOMAIN_MINIMUM to request
  258.      * minimum size.  Defaults to FALSE. */
  259.  
  260. #define CHILD_MaxWidth            (CHILD_Dummy+3)
  261.     /* (ULONG) The maximum width, in pixels, of the object.  Leave blank if
  262.      * you want the maximum size to be calced by the gadget as the largest
  263.      * possible, or use ~0. */
  264.  
  265. #define CHILD_MaxHeight         (CHILD_Dummy+4)
  266.     /* (ULONG) The maximum height, in pixels, of the object.  Leave blank if
  267.      * you want the maximum size to be calced by the gadget as the smallest
  268.      * possible, or use ~0. */
  269.  
  270. #define CHILD_WeightedWidth     (CHILD_Dummy+5)
  271.     /* (ULONG) See CHILD_WeightedHeight. */
  272.  
  273. #define CHILD_WeightedHeight    (CHILD_Dummy+6)
  274.     /* (ULONG) The weighted width or height is a number between 0 and 100;
  275.      * it determines how much space, in relation to the other objects in the
  276.      * group, this particular object should be allowed.  When the width/height
  277.      * for the group is calculated, the allowable space is divided up between
  278.      * the gadgets based on this, and the min/max values.  For instance, if
  279.      * you had two objects, one with a weight of 100 and another with a weight
  280.      * of 50, and the group was 150 pixels wide, 100 would be offered to the
  281.      * first, and 50 to the second; how much space it actually takes depends
  282.      * on whether that particular value exceeds the maximum, the minimum, or
  283.      * the gadget's internal calculations of its minimum or maximum possible
  284.      * width or height.  Both CHILD_WeightedWidth and CHILD_WeightedHeight
  285.      * default to 100.  A value of 0 locks it at the CHILD_MinWidth or
  286.      * CHILD_MinHeight value, respectively. */
  287.  
  288. #define CHILD_ReplaceObject       (CHILD_Dummy+7)
  289.     /* (Object *) The BOOPSI gadget to replace the object with.  The original
  290.      * object is destroyed. */
  291.  
  292. #define CHILD_ReplaceImage        (LAYOUT_Dummy+8)
  293.     /* (Object *) Like CHILD_ReplaceObject, except the replacement object is
  294.      * an image, not a gadget. */
  295.  
  296. #define CHILD_CacheDomain         (CHILD_Dummy+9)
  297.     /* (BOOL) Whether GM_DOMAIN results can be cached to improve performance.
  298.      * Set this to FALSE if you use weird gadgets that can change size on
  299.      * their own. Defaults to TRUE. */
  300.  
  301. #define CHILD_WeightMinimum        (CHILD_Dummy+10)
  302.     /* (BOOL) Makes layout set the weighted size to the values returned by
  303.      * minimum GM_DOMAIN. */
  304.  
  305. #define CHILD_Label                (CHILD_Dummy+12)
  306.     /* (Object *) A label.image to use as the label for this gadget */
  307.  
  308. #define CHILD_NoDispose            (CHILD_Dummy+13)
  309.     /* (BOOL) Set this to true if you don't want layout to automatically
  310.      * dispose the object. */
  311.  
  312. #define CHILD_ScaleHeight       (CHILD_Dummy+14)
  313.     /* (UWORD) Scales min domain size larger by this percentage (0 thru 100). */
  314.  
  315. #define CHILD_ScaleWidth        (CHILD_Dummy+15)
  316.     /* (UWORD See CHILD_ScaleHeight. */
  317.  
  318. #define CHILD_DataType          (CHILD_Dummy+16)
  319.     /* (BOOL) This is a datatype, layout will use DTM_PROCLAYOUT,
  320.      * SetDTAttrs and RefreshDTObject so waiting for DTA_Sync is not
  321.      * required. (V43 BETA) */
  322.  
  323. /*****************************************************************************/
  324.  
  325. /* Special "empty label" value for CHILD_Label
  326.  */
  327. #define LCLABEL_NOLABEL        ((Object *)1)
  328.  
  329. /* Possible values for LAYOUT_Orientation.
  330.  */
  331. #define LAYOUT_HORIZONTAL    0
  332. #define LAYOUT_VERTICAL        1
  333.  
  334. #define LAYOUT_ORIENT_HORIZ    LAYOUT_HORIZONTAL
  335. #define LAYOUT_ORIENT_VERT    LAYOUT_VERTICAL
  336.  
  337. /* Possible values for LAYOUT_HorizAlignment.
  338.  */
  339. #define LALIGN_LEFT        0
  340. #define LALIGN_RIGHT    1
  341. #define LALIGN_CENTER    2
  342. #define LALIGN_CENTRE    LALIGN_CENTER
  343.  
  344. #define LAYOUT_ALIGN_LEFT    LALIGN_LEFT
  345. #define LAYOUT_ALIGN_RIGHT    LALIGN_RIGHT
  346. #define LAYOUT_ALIGN_CENTER    LALIGN_CENTER
  347.  
  348. /* Possible values for LAYOUT_VertAlignment.
  349.  */
  350. #define LALIGN_TOP        0
  351. #define LALIGN_BOTTOM    1
  352. #define LALIGN_CENTER    2
  353. #define LALIGN_CENTRE    LALIGN_CENTER
  354.  
  355. #define LAYOUT_ALIGN_TOP    LALIGN_TOP
  356. #define LAYOUT_ALIGN_BOTTOM    LALIGN_BOTTOM
  357. #define LAYOUT_ALIGN_CENTER    LALIGN_CENTER
  358.  
  359. /*****************************************************************************/
  360.  
  361. /* Page Class tags  */
  362.  
  363. #define PAGE_Dummy                (LAYOUT_Dummy+0x200)
  364.  
  365. #define PAGE_Add                (PAGE_Dummy+1)
  366.     /* (Object *) Add a page to the end of a page group */
  367.  
  368. #define PAGE_Remove                (PAGE_Dummy+2)
  369.     /* (Object *) Remove a page from the page group */
  370.  
  371. #define PAGE_Current            (PAGE_Dummy+3)
  372.     /* (ULONG) Make the n'th page visible. */
  373.  
  374. #define PAGE_FixedVert            (PAGE_Dummy+4)
  375. #define PAGE_FixedHoriz            (PAGE_Dummy+5)
  376.     /* (BOOL) Like the Layout class tags. */
  377.  
  378. #define PAGE_Transparent        (PAGE_Dummy+6)
  379.     /* (BOOL) PRIVATE */
  380.  
  381. #endif  /* GADGETS_LAYOUT_H */
  382.